package za.co.yellowfire.domain;

import za.co.yellowfire.solarflare.annotation.Searchable;
import za.co.yellowfire.solarflare.annotation.SearchableProperty;
import za.co.yellowfire.solarflare.annotation.SearchablePropertyId;

import java.io.Serializable;
import java.util.Date;
import java.util.jar.Attributes;

/**
 * @author Mark P Ashworth
 * @version 0.1
 */
@Searchable(name = "Person")
public class Person implements Serializable {
    private static final long serialVersionUID = 1L;

    @SearchablePropertyId(separator = ".")
    private Long id;

    @SearchableProperty
    private Name name;

    @SearchableProperty(name = "birthDate", dynamic = true)
    private Date dateOfBirth;

    /**
     * Returns the object identity
     * @return Long
     */
    public Long getId() {
        return id;
    }

    /**
     * Sets the object identity of the entity
     * @param id The new value
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Returns the name
     * @return String
     */
    public Name getName() {
        return name;
    }

    /**
     * Sets the name
     * @param name The new value
     */
    public void setName(Name name) {
        this.name = name;
    }

    /**
     * Returns the date of birth
     * @return Date
     */
    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    /**
     * Sets the birth date
     * @param dateOfBirth The new value
     */
    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    /**
     * Returns a string representation of the object
     * @return String
     */
    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name=" + name +
                ", dob=" + dateOfBirth +
                '}';
    }
}
